package service.impl;

import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import dao.TestUserDao;
import pojo.TestUser;
import service.TestUserManager;

@Service(value="testUserManagerImpl")
public class TestUserManagerImpl implements TestUserManager {
	
	@Resource(name="testUserDaoImpl")
	private TestUserDao dao;

	@Override
	public TestUser addUser(TestUser u) {
		u.setId(UUID.randomUUID().toString());
		dao.add(u);
		return u;
	}

	@Override
	public boolean loginUser(String uname, String passwd) {
		TestUser u = dao.load(uname, passwd);
		return u != null;
	}

}
